﻿CREATE proc sp_dmdv_them
@MaDV char(10),
@TenDV nvarchar(200)
as
declare @dem as int
select @dem=count(*) from danhmuc_donvi where MaDV=@MaDV
if(@dem>0)
	begin
	select ErrCode=0
	end
else
	begin
	insert into danhmuc_donvi(MaDV,TenDV)
	values (@MaDV,@TenDV)
	select ErrCode=1
	end